From 078e1918d365eb12ba6b33db6ffdf472bbcda1a7 Mon Sep 17 00:00:00 2001 From: "yamahata@valinux.co.jp" Date: Wed, 26 Apr 2006 10:43:16 +0100 Subject: [PATCH] xenLinux/ia64 has its own dma_map_page(), dma_unmap_page(), and it needs linux default implementations of dma_declare_coheremnt_memory() and its families which is defined in include/linux/dma-mapping.h. So those in pci-dma-xen.c are unnecessary. #ifdef out them. PATCHNAME: pci-dma-xen-common Signed-off-by: Isaku Yamahata --- linux-2.6-xen-sparse/arch/i386/kernel/pci-dma-xen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/pci-dma-xen.c b/linux-2.6-xen-sparse/arch/i386/kernel/pci-dma-xen.c index eb616232c7..2aeaf89c0e 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/pci-dma-xen.c +++ b/linux-2.6-xen-sparse/arch/i386/kernel/pci-dma-xen.c @@ -93,6 +93,13 @@ dma_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, } EXPORT_SYMBOL(dma_unmap_sg); +/* + * XXX This file is also used by xenLinux/ia64. + * "defined(__i386__) || defined (__x86_64__)" means "!defined(__ia64__)". + * This #if work around should be removed once this file is merbed back into + * i386' pci-dma or is moved to drivers/xen/core. + */ +#if defined(__i386__) || defined(__x86_64__) dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction direction) @@ -122,6 +129,7 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, swiotlb_unmap_page(dev, dma_address, size, direction); } EXPORT_SYMBOL(dma_unmap_page); +#endif /* defined(__i386__) || defined(__x86_64__) */ int dma_mapping_error(dma_addr_t dma_addr) @@ -204,6 +212,7 @@ void dma_free_coherent(struct device *dev, size_t size, } EXPORT_SYMBOL(dma_free_coherent); +#ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, dma_addr_t device_addr, size_t size, int flags) { @@ -280,6 +289,7 @@ void *dma_mark_declared_memory_occupied(struct device *dev, return mem->virt_base + (pos << PAGE_SHIFT); } EXPORT_SYMBOL(dma_mark_declared_memory_occupied); +#endif /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, -- 2.30.2